import xadmin
from xadmin import views

from UShop.models import TUser, GainAdress, TbProvince, TbCity, TbArea


class useradmin(object):
    list_display = ["user_id","uaccount",  "uname", "uaddress"]
    search_fields = ["user_id","uname", "uaccount"]
    list_filter = ["user_id","uname", "uaccount","uaddress"]
    list_editable = ["uname", "uaccount","uaddress"]
    list_per_page = 20
    list_max_show_all = 20


class addressadmin(object):
    list_display = ["ad_id","ad_name",  "ad_phone", "ad_mail","ad_aderss"]
    search_fields = ["ad_id","ad_name",  "ad_phone"]
    list_filter = ["ad_id","ad_name"]
    list_editable = ["ad_name", "ad_aderss"]
    list_per_page = 20
    list_max_show_all = 20

class cityadmin(object):
    list_display = ["ci_id","ct_code",  "ct_name", "ct_provincecode"]
    search_fields = ["ct_code",  "ct_name", "ct_provincecode"]
    list_filter = ["ct_code",  "ct_name", "ct_provincecode"]
    list_editable = ["ct_code",  "ct_name", "ct_provincecode"]
    list_per_page = 20
    list_max_show_all = 20


class areaadmin(object):
    list_display = ["ar_id","ar_code",  "ar_name", "ar_citycode"]
    search_fields = ["ar_code",  "ar_name", "ar_citycode"]
    list_filter = ["ar_code",  "ar_name", "ar_citycode"]
    list_editable = ["ar_code",  "ar_name", "ar_citycode"]
    list_per_page = 20
    list_max_show_all = 20

class provinceadmin(object):
    list_display = ["pr_id","ad",  "pr_code", "pr_name"]
    search_fields = ["ad",  "pr_code", "pr_name"]
    list_filter = ["ad",  "pr_code", "pr_name"]
    list_editable = ["ad",  "pr_code", "pr_name"]
    list_per_page = 20
    list_max_show_all = 20


xadmin.site.register(TUser, useradmin)


xadmin.site.register(GainAdress, addressadmin)

xadmin.site.register(TbProvince, provinceadmin)
xadmin.site.register(TbCity, cityadmin)
xadmin.site.register(TbArea, areaadmin)


